package com.grapes.business;

import java.util.LinkedList;
import java.util.List;
import com.grapes.model.CampusTalking;
import com.grapes.model.DailyInfo;
import com.grapes.model.NetApplication;

public class RecruiteInfoBusiness {
	public static final int PROCEDURE_REFUSED = 1;
	public static final int PROCEDURE_APPLICATED = 2;
	public static final int PROCEDURE_STORED = 3;
	
	private static RecruiteInfoBusiness instance;
	private final int REQUEST_COUNT_PER_PAGE=30;

	private RecruiteInfoBusiness() {
	};

	public static RecruiteInfoBusiness getInstance() {
		if (null == instance) {
			instance = new RecruiteInfoBusiness();
		}
		return instance;
	}
	
	public List<CampusTalking> getCampusTalkingBefore(long timestamp)
	{
		return getFakedCampusTalking();
	}
	
	public List<CampusTalking> getCampusTalkingBetween(long from, long to)
	{
		return null;
	}
	
    private List<CampusTalking> getFakedCampusTalking()
    {
    	List<CampusTalking> campusTalkings=new LinkedList<CampusTalking>();
    	final int MAX_CAMPUS_TALKING_NUMBER=50;
    	for(int index=0;index<MAX_CAMPUS_TALKING_NUMBER;index++)
    	{
    		CampusTalking obj=new CampusTalking();
    		obj.setAddress("Address+"+index);
    		obj.setCompanyId(String.valueOf(index));
    		obj.setCompanyName("Company"+index);
    		obj.setDate("09/18");
    		obj.setTime("15:30");
    		obj.setSchoolId(String.valueOf(index));
    		obj.setSchoolName("School"+index);
    		obj.setCommentCount(30+index);
    		obj.setFavoriteCount(45+index);
    		campusTalkings.add(obj);
    	}
    	return campusTalkings;
    }
    
	public List<NetApplication> getNetApplicationBefore(long timestamp)
	{
		return getFakedNetApplication();
	}
	
	public List<NetApplication> getNetApplicationBetween(long from, long to)
	{
		return null;
	}
	
    private List<NetApplication> getFakedNetApplication()
    {
    	List<NetApplication> netAppications=new LinkedList<NetApplication>();
    	final int MAX_CAMPUS_TALKING_NUMBER=50;
    	for(int index=0;index<MAX_CAMPUS_TALKING_NUMBER;index++)
    	{
    		NetApplication obj=new NetApplication();
    		obj.setUrlAddress("www.baidu.com");
    		obj.setCompanyId(String.valueOf(index));
    		obj.setCompanyName("Company"+index);
    		obj.setStartDate("09/18");
    		obj.setStartTime("15:30");
    		obj.setEndDate("10/05");
    		obj.setEndTime("15:30");
    		obj.setCommentCount(30+index);
    		obj.setFavoriteCount(45+index);
    		netAppications.add(obj);
    	}
    	return netAppications;
    }
    
	public List<DailyInfo> getDailyInfoBefore(long timestamp)
	{
		return getFakedDailyInfo();
	}
	
	public List<DailyInfo> getDailyInfoBetween(long from, long to)
	{
		return null;
	}
	
    private List<DailyInfo> getFakedDailyInfo()
    {
    	List<DailyInfo> dailyInfos=new LinkedList<DailyInfo>();
    	final int MAX_CAMPUS_TALKING_NUMBER=50;
    	for(int index=0;index<MAX_CAMPUS_TALKING_NUMBER;index++)
    	{
    		DailyInfo obj=new DailyInfo();
    		obj.setDetail("Detail+"+index);
    		obj.setCompanyId(String.valueOf(index));
    		obj.setCompanyName("Company"+index);
//    		obj.setDate("09/18");
//    		obj.setTime("15:30");
    		obj.setCommentCount(30+index);
    		obj.setFavoriteCount(45+index);
    		dailyInfos.add(obj);
    	}
    	return dailyInfos;
    }
}
